<template>
  <div>
    <h2>计数器</h2>
    <p>当前计数: {{ count }}</p>
    <button @click="increment">增加</button>
    <button @click="decrement">减少</button>
    <input v-model="customValue" type="number" />
    <button @click="setCount">设置计数</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
const count = ref(0)
const customValue = ref(0)

const increment = () => count.value++
const decrement = () => count.value--
const setCount = () => count.value = customValue.value
</script>
